<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Scrollbars Module Level 1</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="revising" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="CSS Scrollbars standardizes the ability to color scrollbars introduced in 2000 by Windows IE 5.5.             This is useful when building web applications which use color schemes very different from             the appearance of default platform scrollbars." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://drafts.csswg.org/css-scrollbars/" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Scrollbars Module Level 1</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-scrollbars/">https://drafts.csswg.org/css-scrollbars/</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard" data-editor-id="1464"><a class="p-name fn u-url url" href="http://tantek.com/contact">Tantek Çelik</a> (<a class="p-org org" href="https://www.mozilla.org/">Mozilla</a>)
      <dd class="editor p-author h-card vcard" data-editor-id="49885"><a class="p-name fn u-email email" href="mailto:ratan@microsoft.com">Rossen Atanassov</a> (<span class="p-org org">Microsoft</span>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-scrollbars-1/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-scrollbars-1">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>CSS Scrollbars standardizes the ability to color scrollbars introduced in 2000 by Windows IE 5.5.

          This is useful when building web applications which use color schemes very different from 
          the appearance of default platform scrollbars.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-scrollbars” in the title,
	preferably like this:
	“[css-scrollbars] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li>
     <a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a>
     <ol class="toc">
      <li><a href="#scope"><span class="secno">1.1</span> <span class="content"> Scope</span></a>
      <li><a href="#values"><span class="secno">1.2</span> <span class="content"> Values</span></a>
     </ol>
    <li><a href="#scrollbar-color"><span class="secno">2</span> <span class="content">Scrollbar Colors: the <span class="property">scrollbar-color</span> property</span></a>
    <li><a href="#scrollbar-width"><span class="secno">3</span> <span class="content">Scrollbar Thickness: the <span class="property">scrollbar-width</span> property</span></a>
    <li><a href="#acknowledgments"><span class="secno"></span> <span class="content">Appendix A. Acknowledgments</span></a>
    <li><a href="#changes"><span class="secno"></span> <span class="content">Appendix B. Changes</span></a>
    <li><a href="#security-privacy-considerations"><span class="secno"></span> <span class="content">Appendix C. Considerations for Security and Privacy</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
      <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p class="note" role="note"><span>Note:</span> this specification is <a href="https://github.com/w3c/csswg-drafts/tree/master/css-scrollbars-1"> maintained in the W3C csswg-drafts GitHub repository as css-scrollbars-1 </a>.</p>
   <h3 class="heading settled" data-level="1.1" id="scope"><span class="secno">1.1. </span><span class="content"> Scope</span><a class="self-link" href="#scope"></a></h3>
    <em>This subsection is non-normative.</em> 
   <p>Based on <a href="https://www.w3.org/wiki/Css-scrollbars#Use-cases">documented use-cases</a>,
there are three main use-cases around scrollbars this module intends to resolve:</p>
   <ol>
    <li>Color scrollbars to fit better into the UI of a web application. 
    <li>Use thinner scrollbar when the scrolling area is small. 
    <li>Build customized scrollbars without affecting scrollability. 
   </ol>
   <p>For addressing these use-cases, this module adds properties to control colors and
width of scrollbars (if any) of an element.</p>
   <p>Pseudo-elements for selecting specific parts of a scrollbar is out of scope.
The WebKit implementation of pseudo-elements for scrollbar is
considered to be a feature mistakenly exposed to the web.
Main concerns against the pseudo-elements approach are:</p>
   <ul>
    <li>Operating systems continuously evolve their scrollbar designs to provide better user experience,
 beyond the ability of any set of pseudo-elements to accurately model this over time. 
    <li>Different platforms have different scrollbar structure means testing interop is harder,
 because authors would need to take not only engine but also platforms into account. 
   </ul>
   <h3 class="heading settled" data-level="1.2" id="values"><span class="secno">1.2. </span><span class="content"> Values</span><a class="self-link" href="#values"></a></h3>
   <p>This specification follows the <a href="https://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> from <a data-link-type="biblio" href="#biblio-css2">[CSS2]</a>.
  Value types not defined in this specification are defined in CSS Values &amp; Units <a data-link-type="biblio" href="#biblio-css-values-3">[CSS-VALUES-3]</a>.
  Other CSS modules may expand the definitions of these value types.</p>
   <p>In addition to the property-specific values listed in their definitions,
  all properties defined in this specification
  also accept the <a data-link-type="dfn" href="https://drafts.csswg.org/css-values-4/#css-wide-keywords" id="ref-for-css-wide-keywords">CSS-wide keywords</a> keywords as their property value.
  For readability they have not been repeated explicitly.</p>
   <h2 class="heading settled" data-level="2" id="scrollbar-color"><span class="secno">2. </span><span class="content">Scrollbar Colors: the <a class="property" data-link-type="propdesc" href="#propdef-scrollbar-color" id="ref-for-propdef-scrollbar-color">scrollbar-color</a> property</span><a class="self-link" href="#scrollbar-color"></a></h2>
   <table class="def propdef" data-link-for-hint="scrollbar-color">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-scrollbar-color">scrollbar-color</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> dark <span id="ref-for-comb-one①">|</span> light <span id="ref-for-comb-one②">|</span> <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-color-3/#valuea-def-color" id="ref-for-valuea-def-color" title="Expands to: indigo | gold | firebrick | indianred | yellow | darkolivegreen | darkseagreen | slategrey | darkslategrey | mediumvioletred | mediumorchid | transparent | chartreuse | mediumslateblue | black | springgreen | crimson | lightsalmon | brown | turquoise | olivedrab | cyan | silver | skyblue | gray | darkturquoise | goldenrod | darkgreen | darkviolet | darkgray | lightpink | teal | darkmagenta | lightgoldenrodyellow | lavender | yellowgreen | thistle | violet | navy | dimgrey | orchid | blue | ghostwhite | honeydew | cornflowerblue | darkblue | darkkhaki | mediumpurple | cornsilk | red | bisque | slategray | darkcyan | khaki | wheat | deepskyblue | rebeccapurple | darkred | steelblue | aliceblue | lightslategrey | gainsboro | mediumturquoise | floralwhite | coral | purple | lightgrey | lightcyan | darksalmon | beige | azure | lightsteelblue | oldlace | greenyellow | royalblue | lightseagreen | mistyrose | sienna | lightcoral | orangered | navajowhite | lime | palegreen | burlywood | seashell | mediumspringgreen | fuchsia | papayawhip | blanchedalmond | peru | aquamarine | white | darkslategray | tomato | ivory | dodgerblue | currentcolor | lemonchiffon | chocolate | orange | forestgreen | darkgrey | olive | mintcream | antiquewhite | darkorange | cadetblue | moccasin | limegreen | saddlebrown | grey | darkslateblue | lightskyblue | deeppink | plum | aqua | darkgoldenrod | maroon | sandybrown | magenta | tan | rosybrown | pink | lightblue | palevioletred | mediumseagreen | slateblue | dimgray | powderblue | seagreen | snow | mediumblue | midnightblue | paleturquoise | palegoldenrod | whitesmoke | darkorchid | salmon | lightslategray | lawngreen | lightgreen | lightgray | hotpink | lightyellow | lavenderblush | linen | mediumaquamarine | green | blueviolet | peachpuff">&lt;color></a><a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#mult-num" id="ref-for-mult-num">{2}</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>auto
     <tr>
      <th>Applies to:
      <td>boxes to which <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow">overflow</a> applies
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>yes
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword or two computed colors
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value
   </table>
   <p>This property allows the author to set colors of an element’s scrollbars.</p>
   <p>UAs must apply the scrollbar-color value set on the root element to the viewport.</p>
   <p class="note" role="note"><span>Note:</span> Unlike <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow①">overflow</a> (and overflow-*) properties,
scrollbar-color value set on the HTML body element are not propagated to the viewport.</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="scrollbar-color" data-dfn-type="value" data-export id="valdef-scrollbar-color-auto">auto</dfn>
    <dd>default platform rendering for the scrollbar.
    <dt><dfn class="css" data-dfn-for="scrollbar-color" data-dfn-type="value" data-export id="valdef-scrollbar-color-dark">dark<a class="self-link" href="#valdef-scrollbar-color-dark"></a></dfn>
    <dd> show a dark scrollbar,
which can be either a dark variant of scrollbar provided by the platform,
or a custom scrollbar with dark colors. 
    <dt><dfn class="css" data-dfn-for="scrollbar-color" data-dfn-type="value" data-export id="valdef-scrollbar-color-light">light<a class="self-link" href="#valdef-scrollbar-color-light"></a></dfn>
    <dd> show a light scrollbar,
which can be either a light variant of scrollbar provided by the platform,
or a custom scrollbar with light colors. 
    <dt><dfn class="css" data-dfn-for="scrollbar-color" data-dfn-type="value" data-export id="valdef-scrollbar-color-color"><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-color-3/#valuea-def-color" id="ref-for-valuea-def-color①" title="Expands to: indigo | gold | firebrick | indianred | yellow | darkolivegreen | darkseagreen | slategrey | darkslategrey | mediumvioletred | mediumorchid | transparent | chartreuse | mediumslateblue | black | springgreen | crimson | lightsalmon | brown | turquoise | olivedrab | cyan | silver | skyblue | gray | darkturquoise | goldenrod | darkgreen | darkviolet | darkgray | lightpink | teal | darkmagenta | lightgoldenrodyellow | lavender | yellowgreen | thistle | violet | navy | dimgrey | orchid | blue | ghostwhite | honeydew | cornflowerblue | darkblue | darkkhaki | mediumpurple | cornsilk | red | bisque | slategray | darkcyan | khaki | wheat | deepskyblue | rebeccapurple | darkred | steelblue | aliceblue | lightslategrey | gainsboro | mediumturquoise | floralwhite | coral | purple | lightgrey | lightcyan | darksalmon | beige | azure | lightsteelblue | oldlace | greenyellow | royalblue | lightseagreen | mistyrose | sienna | lightcoral | orangered | navajowhite | lime | palegreen | burlywood | seashell | mediumspringgreen | fuchsia | papayawhip | blanchedalmond | peru | aquamarine | white | darkslategray | tomato | ivory | dodgerblue | currentcolor | lemonchiffon | chocolate | orange | forestgreen | darkgrey | olive | mintcream | antiquewhite | darkorange | cadetblue | moccasin | limegreen | saddlebrown | grey | darkslateblue | lightskyblue | deeppink | plum | aqua | darkgoldenrod | maroon | sandybrown | magenta | tan | rosybrown | pink | lightblue | palevioletred | mediumseagreen | slateblue | dimgray | powderblue | seagreen | snow | mediumblue | midnightblue | paleturquoise | palegoldenrod | whitesmoke | darkorchid | salmon | lightslategray | lawngreen | lightgreen | lightgray | hotpink | lightyellow | lavenderblush | linen | mediumaquamarine | green | blueviolet | peachpuff">&lt;color></a><a class="self-link" href="#valdef-scrollbar-color-color"></a></dfn>
    <dd> apply the first color to the thumb of the scrollbar,
and the second color to the track of the scrollbar. 
   </dl>
   <p>Details:</p>
   <p>Track refers to the background of the scrollbar,
which is generally fixed regardless of the scrolling position.</p>
   <p>Thumb refers to the moving part of the scrollbar,
which usually floats on top of the track.</p>
   <p>If this property computes to value other than <a class="css" data-link-type="maybe" href="#valdef-scrollbar-color-auto" id="ref-for-valdef-scrollbar-color-auto">auto</a>,
implementations may render a simpler scrollbar than the default platform UI rendering,
and color it accordingly.</p>
   <p>(Note: add diagram showing the different named pieces - something like <a href="http://www.howtocreate.co.uk/tutorials/scrlbar.html">http://www.howtocreate.co.uk/tutorials/scrlbar.html</a>)</p>
   <p>(Note: add example of an overflow element with colorized scrollbars to match page styling,
PNG of the same in a browser that supports it currently)</p>
   <p>Implementations may ignore any of the colors
if the corresponding part do not exist on the underlying platform.</p>
   <p>When using scrollbar-color property with specific color values,
authors should ensure the specified colors have enough contrast between them.
For keyword values, UAs should ensure the colors they use have enough contrast.
See <a href="https://www.w3.org/TR/WCAG20-TECHS/G183.html"> Techniques for WCAG 2.0: G183: Using a contrast ratio of 3:1 […]</a> <a data-link-type="biblio" href="#biblio-wcag20">[WCAG20]</a>.</p>
   <p class="note" role="note"><span>Note:</span> when a user interacts with a scrollbar (e.g. hovering or activating),
implementations may alter which scrollbar colors apply to which scrollbar parts.</p>
   <p class="note" role="note"><span>Note:</span> IE uses named System Colors as defaults for each of the scrollbar color properties.
See related <a href="https://github.com/w3c/csswg-drafts/issues/1956">Issue 1956</a>.</p>
   <div class="example" id="example-8bd6d072">
    <a class="self-link" href="#example-8bd6d072"></a> 
    <p>The following example 
    (derived from <a href="https://www.w3.org/Style/Examples/007/scrollbars.en.html">https://www.w3.org/Style/Examples/007/scrollbars.en.html</a>) 
    resets scrollbar colors in IE.</p>
<pre><code class="css">html { 
    scrollbar-color: ThreeDFace Scrollbar;
}</code></pre>
   </div>
   <h2 class="heading settled" data-level="3" id="scrollbar-width"><span class="secno">3. </span><span class="content">Scrollbar Thickness: the <a class="property" data-link-type="propdesc" href="#propdef-scrollbar-width" id="ref-for-propdef-scrollbar-width">scrollbar-width</a> property</span><a class="self-link" href="#scrollbar-width"></a></h2>
   <table class="def propdef" data-link-for-hint="scrollbar-width">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-scrollbar-width">scrollbar-width</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one③">|</a> thin <span id="ref-for-comb-one④">|</span> none
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>auto
     <tr>
      <th>Applies to:
      <td>boxes to which <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow②">overflow</a> applies
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword or absolute length
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>by computed value
   </table>
   <p>This property allows the author to set the maximum thickness of an element’s scrollbars when they are shown.</p>
   <dl>
    <dt><dfn class="dfn-paneled css" data-dfn-for="scrollbar-width" data-dfn-type="value" data-export id="valdef-scrollbar-width-auto">auto</dfn>
    <dd>implementations must use the default platform scrollbar width. 
    <dt><dfn class="css" data-dfn-for="scrollbar-width" data-dfn-type="value" data-export id="valdef-scrollbar-width-thin">thin<a class="self-link" href="#valdef-scrollbar-width-thin"></a></dfn>
    <dd>
     Implementations should use thinner scrollbars than <a class="css" data-link-type="maybe" href="#valdef-scrollbar-width-auto" id="ref-for-valdef-scrollbar-width-auto">auto</a> when applicable.
This may mean a thin variant of scrollbar provided by the platform,
or a custom scrollbar thinner than the default platform scrollbar. 
     <p class="note" role="note"><span>Note:</span> Some platforms may only have a tiny scrollbar by default
which cannot be or makes no sense to make thinner.
In that case, implementations may treat this value as <a class="css" data-link-type="maybe" href="#valdef-scrollbar-width-auto" id="ref-for-valdef-scrollbar-width-auto①">auto</a>.</p>
    <dt><dfn class="css" data-dfn-for="scrollbar-width" data-dfn-type="value" data-export id="valdef-scrollbar-width-none">none<a class="self-link" href="#valdef-scrollbar-width-none"></a></dfn>
    <dd>implementations must not display any scrollbar, however the element’s scrollability is not affected. 
   </dl>
   <p>UAs must apply the scrollbar-width value set on the root element to the viewport.</p>
   <p class="note" role="note"><span>Note:</span> Unlike <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow" id="ref-for-propdef-overflow③">overflow</a> (and overflow-*) properties,
a scrollbar-width value set on the HTML body element is not propagated to the viewport.</p>
   <p class="note" role="note"><span>Note:</span> This specification does not define the exact position or shape of the scrollbar,
or any animation thereof, such as fading or sliding in/out of view.</p>
   <h2 class="no-num heading settled" id="acknowledgments"><span class="content">Appendix A. Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2>
   <p>This appendix is <em>informative</em>.</p>
   <p> Thanks to the use-cases, prototyping, implementation, and feedback from <span class="h-card">Tab Atkins</span> and <span class="h-card">Xidorn Quan</span>. </p>
   <h2 class="no-num heading settled" id="changes"><span class="content">Appendix B. Changes</span><a class="self-link" href="#changes"></a></h2>
   <p>This appendix is <em>informative</em>.</p>
   <p>This is the First Public Working Draft, no previous draft to describe changes from.</p>
   <h2 class="no-num heading settled" id="security-privacy-considerations"><span class="content">Appendix C. Considerations for Security and Privacy</span><a class="self-link" href="#security-privacy-considerations"></a></h2>
   <p>This appendix is <em>informative</em>.</p>
   <p>Per the <a href="https://www.w3.org/TR/security-privacy-questionnaire/#questions"> Self-Review Questionnaire: Security and Privacy: Questions to Consider</a></p>
   <ol>
    <li>
     Does this specification deal with personally-identifiable information? 
     <p>No.</p>
    <li>
     Does this specification deal with high-value data? 
     <p>No.</p>
    <li>
     Does this specification introduce new state for an origin that persists across browsing sessions? 
     <p>No.</p>
    <li>
     Does this specification expose persistent, cross-origin state to the web? 
     <p>No.</p>
    <li>
     Does this specification expose any other data to an origin that it doesn’t currently have access to? 
     <p>No.</p>
    <li>
     Does this specification enable new script execution/loading mechanisms? 
     <p>No.</p>
    <li>
     Does this specification allow an origin access to a user’s location? 
     <p>No.</p>
    <li>
     Does this specification allow an origin access to sensors on a user’s device? 
     <p>No.</p>
    <li>
     Does this specification allow an origin access to aspects of a user’s local computing environment? 
     <p>No.</p>
    <li>
     Does this specification allow an origin access to other devices? 
     <p>No.</p>
    <li>
     Does this specification allow an origin some measure of control over a user agent’s native UI? 
     <p>Yes. The <a class="property" data-link-type="propdesc">scrollbar-*</a> properties enable the page to change the color and width of the scrollbar 
of the user agent’s native UI, e.g. scrollbars on the page’s window, on framed content embedded in the page, 
or on overflowing elements with scrollbars in the page.</p>
    <li>
     Does this specification expose temporary identifiers to the web? 
     <p>No.</p>
    <li>
     Does this specification distinguish between behavior in first-party and third-party contexts? 
     <p>No.</p>
    <li>
     How should this specification work in the context of a user agent’s "incognito" mode? 
     <p>No differently.</p>
    <li>
     Does this specification persist data to a user’s local device? 
     <p>No.</p>
    <li>
     Does this specification have a "Security Considerations" and "Privacy Considerations" section? 
     <p>Yes.</p>
    <li>
     Does this specification allow downgrading default security characteristics? 
     <p>No.</p>
   </ol>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li>
    auto
    <ul>
     <li><a href="#valdef-scrollbar-color-auto">value for scrollbar-color</a><span>, in §2</span>
     <li><a href="#valdef-scrollbar-width-auto">value for scrollbar-width</a><span>, in §3</span>
    </ul>
   <li><a href="#valdef-scrollbar-color-color">&lt;color></a><span>, in §2</span>
   <li><a href="#valdef-scrollbar-color-dark">dark</a><span>, in §2</span>
   <li><a href="#valdef-scrollbar-color-light">light</a><span>, in §2</span>
   <li><a href="#valdef-scrollbar-width-none">none</a><span>, in §3</span>
   <li><a href="#propdef-scrollbar-color">scrollbar-color</a><span>, in §2</span>
   <li><a href="#propdef-scrollbar-width">scrollbar-width</a><span>, in §3</span>
   <li><a href="#valdef-scrollbar-width-thin">thin</a><span>, in §3</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-valuea-def-color">
   <a href="https://drafts.csswg.org/css-color-3/#valuea-def-color">https://drafts.csswg.org/css-color-3/#valuea-def-color</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valuea-def-color">2. Scrollbar Colors: the scrollbar-color property</a> <a href="#ref-for-valuea-def-color①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-overflow">
   <a href="https://drafts.csswg.org/css-overflow-3/#propdef-overflow">https://drafts.csswg.org/css-overflow-3/#propdef-overflow</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-overflow">2. Scrollbar Colors: the scrollbar-color property</a> <a href="#ref-for-propdef-overflow①">(2)</a>
    <li><a href="#ref-for-propdef-overflow②">3. Scrollbar Thickness: the scrollbar-width property</a> <a href="#ref-for-propdef-overflow③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-css-wide-keywords">
   <a href="https://drafts.csswg.org/css-values-4/#css-wide-keywords">https://drafts.csswg.org/css-values-4/#css-wide-keywords</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-css-wide-keywords">1.2. 
Values</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-mult-num">
   <a href="https://drafts.csswg.org/css-values-4/#mult-num">https://drafts.csswg.org/css-values-4/#mult-num</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-mult-num">2. Scrollbar Colors: the scrollbar-color property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">2. Scrollbar Colors: the scrollbar-color property</a> <a href="#ref-for-comb-one①">(2)</a> <a href="#ref-for-comb-one②">(3)</a>
    <li><a href="#ref-for-comb-one③">3. Scrollbar Thickness: the scrollbar-width property</a> <a href="#ref-for-comb-one④">(2)</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-color-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-valuea-def-color" style="color:initial">&lt;color></span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-overflow" style="color:initial">overflow</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-css-wide-keywords" style="color:initial">css-wide keywords</span>
     <li><span class="dfn-paneled" id="term-for-mult-num" style="color:initial">{a}</span>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-color-3">[CSS-COLOR-3]
   <dd>Tantek Çelik; Chris Lilley; David Baron. <a href="https://www.w3.org/TR/css-color-3/">CSS Color Module Level 3</a>. 19 June 2018. REC. URL: <a href="https://www.w3.org/TR/css-color-3/">https://www.w3.org/TR/css-color-3/</a>
   <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3]
   <dd>David Baron; Elika Etemad; Florian Rivoal. <a href="https://www.w3.org/TR/css-overflow-3/">CSS Overflow Module Level 3</a>. 31 July 2018. WD. URL: <a href="https://www.w3.org/TR/css-overflow-3/">https://www.w3.org/TR/css-overflow-3/</a>
   <dt id="biblio-css-values-3">[CSS-VALUES-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-3/">CSS Values and Units Module Level 3</a>. 31 January 2019. CR. URL: <a href="https://www.w3.org/TR/css-values-3/">https://www.w3.org/TR/css-values-3/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css2">[CSS2]
   <dd>Bert Bos; et al. <a href="https://www.w3.org/TR/CSS2/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. REC. URL: <a href="https://www.w3.org/TR/CSS2/">https://www.w3.org/TR/CSS2/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
  </dl>
  <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
  <dl>
   <dt id="biblio-wcag20">[WCAG20]
   <dd>Ben Caldwell; et al. <a href="https://www.w3.org/TR/WCAG20/">Web Content Accessibility Guidelines (WCAG) 2.0</a>. 11 December 2008. REC. URL: <a href="https://www.w3.org/TR/WCAG20/">https://www.w3.org/TR/WCAG20/</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scrollbar-color" id="ref-for-propdef-scrollbar-color①">scrollbar-color</a>
      <td>auto | dark | light | &lt;color>{2}
      <td>auto
      <td>boxes to which overflow applies
      <td>yes
      <td>n/a
      <td>by computed value
      <td>per grammar
      <td>specified keyword or two computed colors
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-scrollbar-width" id="ref-for-propdef-scrollbar-width①">scrollbar-width</a>
      <td>auto | thin | none
      <td>auto
      <td>boxes to which overflow applies
      <td>no
      <td>n/a
      <td>by computed value
      <td>per grammar
      <td>specified keyword or absolute length
   </table>
  </div>
  <aside class="dfn-panel" data-for="propdef-scrollbar-color">
   <b><a href="#propdef-scrollbar-color">#propdef-scrollbar-color</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scrollbar-color">2. Scrollbar Colors: the scrollbar-color property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-scrollbar-color-auto">
   <b><a href="#valdef-scrollbar-color-auto">#valdef-scrollbar-color-auto</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-scrollbar-color-auto">2. Scrollbar Colors: the scrollbar-color property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-scrollbar-width">
   <b><a href="#propdef-scrollbar-width">#propdef-scrollbar-width</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scrollbar-width">3. Scrollbar Thickness: the scrollbar-width property</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-scrollbar-width-auto">
   <b><a href="#valdef-scrollbar-width-auto">#valdef-scrollbar-width-auto</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-scrollbar-width-auto">3. Scrollbar Thickness: the scrollbar-width property</a> <a href="#ref-for-valdef-scrollbar-width-auto①">(2)</a>
   </ul>
  </aside>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>